package pl.lwozniak.blip;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Properties;

import pl.lwozniak.blip.entities.Status;

/**
 * Utility for testing single calls w/o running whole test suit.
 * 
 * @author Lukasz Wozniak
 * 
 */
public class Util {

	/**
	 * @param args
	 * @throws IOException
	 * @throws BlipConnectorException
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		Properties props = new Properties();
		InputStream is = Util.class.getClassLoader().getResourceAsStream(
				"test.properties");
		props.load(is);
		String username = props.getProperty("username");
		String password = props.getProperty("password");
		BlipConnector bc = new BlipConnector(username, password, null, null);
		// bc.createDirectedMessage("Testing", "blip");
//		File f = new File("bloody_kiss.jpg");
//		bc.createStatus("api test", new FileInputStream(f), f.getName(), null,
//				f.length());
//		System.out.println(bc.getUpdates(0, 0));
		
		System.out.println(">>>>>>>>> Notices");
		List<? extends Status> res = bc.getNotices(10,10, 0);
		for (Status status : res) {
			System.out.println(status);
		}
//		System.out.println(">>>>>>>>> Dashboard");
//		res = bc.getDashboard(10,10, 0);
//		for (Status status : res) {
//			System.out.println(status);
//		}
		
		
	}

}
